Skip to content

Change the ansi support detection to return true for Windows 10+#49571

Open
plumstone wants to merge 1 commit intospring-projects:mainfrom
plumstone:implement-windows-ansi-support-detection
Open

Change the ansi support detection to return true for Windows 10+#49571
plumstone wants to merge 1 commit intospring-projects:mainfrom
plumstone:implement-windows-ansi-support-detection

Conversation

@plumstone
Copy link

Enhancement proposal

Windows supports console ANSI output since build 10586 (End of 2015). Therefore I thought it would make sense to update the ANSI support detection in Spring Boot.

The only slight issue I noticed is that the JDK does not return the build number for Windows systems which in result cannot be checked. https://github.com/openjdk/jdk/blob/master/src/java.base/windows/native/libjava/java_props_md.c#L502

So with this change only the earliest versions of Windows 10 until 2016 (which are no longer supported anyway) would give out a wrong result whether they support ANSI.

Now I need your feedback. Is this acceptable? Should I add more test cases?

Thanks in advance. :)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 11, 2026
Signed-off-by: Philemon Hilscher <philemon847@gmail.com>
@plumstone plumstone force-pushed the implement-windows-ansi-support-detection branch from 56d6be5 to 4e6a7d3 Compare March 11, 2026 22:12
@philwebb
Copy link
Member

We've had a similar request in the past and found ANSI support in Windows quite hard to get working consistently. See #34835 (comment) for some previous analysis.

If we do consider this again, I think it should be for Windows 11+ only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants